home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / nasanets.zip / NET.H < prev    next >
Text File  |  1990-06-07  |  3KB  |  61 lines

  1.  
  2. /*=============================*/
  3. /*           NETS              */
  4. /*                             */
  5. /* a product of the AI Section */
  6. /* NASA, Johnson Space Center  */
  7. /*                             */
  8. /* principal author:           */
  9. /*       Paul Baffes           */
  10. /*                             */
  11. /* contributing authors:       */
  12. /*      Bryan Dulock           */
  13. /*      Chris Ortiz            */
  14. /*=============================*/
  15.  
  16.  
  17. /*
  18. ----------------------------------------------------------------------
  19.   OVERALL NERUAL NET MODULE  
  20. ----------------------------------------------------------------------
  21.   The structure defined below for a Net is pretty self-explanatory. 
  22.   One must keep track of the number of layers and the parameters for
  23.   the back propagation algorithm (ie, learning_rate, momentum, etc.)
  24.   There are a few peculiarities, however. Note that the input and 
  25.   output layer are separated from the rest of the layers.  This is
  26.   because these layers are given their values (during learning) from
  27.   a file of inputs specified by the user, unlike other layers which 
  28.   have their values calculated.  Also note that there are TWO pointers
  29.   to the list of layers (a doubly linked list). One points to the
  30.   beginning for use when propagating forwards, and the other to the end
  31.   for propagating backwards.  Lastly, please note that no weights are 
  32.   shown here as part of the net.  This is because there is really no way
  33.   to talk about a weight without refering to the layers which it connects. 
  34.   Thus the weight definitions go along with the layer descriptions.        
  35. ----------------------------------------------------------------------
  36.  4-13-89  I got rid of the learning rate, learning scale, and momentum
  37.   from this structure. Because some discrepancies exists as to whether 
  38.   or not each layer should have a different learning rate, I decided to
  39.   move these elements to the layer structures.  If a constant rate is
  40.   still desired, it will end up being the same for each layer.
  41. ----------------------------------------------------------------------
  42. */
  43.  
  44.  
  45. typedef struct net_str {
  46.    int        ID;            /* identification tag, -1 if error during   */
  47.                              /* creation of the net.                     */
  48.    int        num_layers;    /* ALL layers in the net                    */
  49.    Layer      *input_layer;
  50.    Layer      *output_layer;
  51.    Layer_lst  *hidden_front; /* ptr to start of hidden layers list       */
  52.    Layer_lst  *hidden_back;  /* ptr to end of hidden layers list         */
  53.                              /* Note that the hidden layers list         */
  54.                              /* should be in order of evaluation so that */
  55.                              /* forward/backward propagation will work   */
  56.    int        use_biases;    /* boolean indicating bias used/not used    */
  57.    int        num_inputs;    /* number of nodes in input layer           */
  58.    int        num_outputs;   /* number of nodes in output layer          */
  59.    int        num_io_pairs;  /* number of i/o pairs for testing          */
  60. } Net;
  61.